﻿using System;
using System.Collections.Generic;
using System.Linq;
using KaytechSoftware.Cms.Entities;
using KaytechSoftware.Cms.Entities.Interfaces;
using KaytechSoftware.Cms.Services.Dto;
using KaytechSoftware.Cms.Services.Interfaces;
using KaytechSoftware.Cms.Services.Interfaces.Entity;

namespace KaytechSoftware.Cms.Services.Services.Entity
{
    public class LeftSideRendererService : EntityBaseService<LeftSideRenderer, LeftSideRendererDto>, ILeftSideRendererService
    {
        public LeftSideRendererService(IUnitOfWorkService unitOfWorkService, IRepository<LeftSideRenderer> leftSideRendererRepository) : base(unitOfWorkService, leftSideRendererRepository)
        {
        }

        public override void Save(LeftSideRendererDto dto)
        {
            throw new NotImplementedException();
        }

        public override IList<LeftSideRendererDto> GetAll()
        {
            using (UnitOfWorkService.Create())
            {
                var pages = EntityRepository.GetAll().ToList();
                return pages.Select(r => new LeftSideRendererDto(r)).ToList();
            }
        }
    }
}
